home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MACD 5
/
MACD 5.bin
/
internet
/
yam_i_dodatki
/
yamattachmail
/
attachmail.dopus5
next >
Wrap
Text File
|
1997-02-01
|
3KB
|
96 lines
/* AttachMail for Directory Opus 5.5 and YAM 1.3.4+
By Dominique Dutoit (dominique@arcadis.be)
Roughly based on ADPro_BatchConvert.dopus5 by Leo 'Nudel' Davidson
*/
OPTIONS RESULTS
PARSE ARG dOpusPort sourceHandle encodeType
dOpusPort = STRIP(dOpusPort,"B",'" ')
sourceHandle = STRIP(sourceHandle,"B",'" ')
encodeType = STRIP(encodeType,"B",'" ')
IF dOpusPort="" THEN DO
SAY "Not correctly called from Directory Opus 5!"
SAY "Load this ARexx script into an editor for more info."
EXIT
END
If ~SHOW("P",dOpusPort) THEN DO
SAY dOpusPort "is not a valid port."
EXIT
END
IF (encodeType ~="UU") | (encodeType ~="MIME") THEN encodeType="MIME"
ADDRESS VALUE dOpusPort
dopus version
IF ( result='RESULT' | TRANSLATE(result,'.',' ') < 5.1218 ) THEN DO
dopus request '"This script requires DOpus v5.5 or greater." OK'
EXIT
END
IF ~SHOW('Ports','YAM') THEN DO
dopus request "'This script requires YAM running on your Amiga.'"
EXIT
END
lister set sourceHandle busy 1
lister query sourceHandle numselentries
listerNumSelEnt = RESULT
lister query sourceHandle path
listerPath = STRIP(RESULT,"B",'"')
lister set sourceHandle newprogress abort bar info name title
lister set sourceHandle newprogress title "Attaching files..."
lister set sourceHandle newprogress info "Warming up"
lister set sourceHandle newprogress bar listerNumSelEnt
barTotal = listerNumSelEnt
DO i = 1 TO listerNumSelEnt
lister query sourceHandle firstsel
tempName = STRIP(RESULT,"B",'"')
tempPath = listerPath || tempName
lister set sourceHandle newprogress name tempName
lister set sourceHandle newprogress bar listerNumSelEnt i
lister query sourceHandle abort
IF RESULT=1 THEN CALL EndAbort
lister set sourceHandle newprogress file barTotal i
dopus getfiletype tempPath id
fileType = STRIP(RESULT,"B",'"')
IF fileType ~="" THEN DO
SELECT
WHEN fileType = "JPEG" THEN tempMIME = "image/jpeg"
WHEN fileType = "GIF" THEN tempMIME = "image/gif"
WHEN fileType = "MPEG" THEN tempMIME = "video/mpeg"
WHEN fileType = "HTML" THEN tempMIME = "text/plain"
WHEN fileType = "8SVX" THEN tempMIME = "audio/basic"
OTHERWISE tempMIME = "application/octet-stream"
END
lister set sourceHandle newprogress info "MIME type is " || tempMIME
ADDRESS 'YAM' WriteAttach tempPath fileType encodeType tempMIME
END
lister select sourceHandle '"'tempName'"' 0
lister query sourceHandle abort
IF RESULT=1 THEN CALL EndAbort
END
EndAbort:
lister set sourceHandle newprogress off
lister refresh sourceHandle
lister set sourceHandle busy 0
EXIT